home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-14 | 11.1 KB | 257 lines | [TEXT/MPS ] |
- ;-------------------------------------------------------------------
- ;
- ;File: ExROM1Fun.a
- ;Dev system: MPW 3.0
- ;By: MacDTS
- ;Date: 3/8/89
- ;
- ; This is a very small sample declaration ROM with the required board
- ; sResource and a functional sResource (which is phony and blank at this time).
- ; The board id and functional sResource types are especially bogus - these values
- ; must be obtained from MacDTS, after sending in the required information.
- ; Anyway, this file is meant to show how to put together a ROM. Other references
- ; are the Cards and Drivers manual, with the source code for a ROM and driver
- ; (both are stripped down versions of the Apple Macintosh Video card ROM and
- ; video driver (aka the TFB board). There are also other examples and exploded
- ; drawings of other declaration ROMs up on AppleLink which you can download. To
- ; get to them, go into (in order):
- ;
- ; Developer Services icon
- ; Developer Technical Support folder
- ; Macintosh folder
- ; Tools folder
- ; Card Dev tools folder
- ;
- ;
- ;In the Card Dev tools folder, there are other folders containing tools and
- ;libraries. Those include:
- ;
- ;Examples folder - contains example declaration ROMs, video driver,
- ; source to a program like the GetsInfo program found
- ; in the Slot Tools folder
- ;Gamma Information folder - contains documention discussing gamma table format.
- ; This will be updated in later documentation for the
- ; new 32-bit QuickDraw. Contact Evangelism for
- ; information on this project. This folder won't be
- ; updated while seeding is going on, so the place to
- ; get it will be through Evangelism, and most likely,
- ; later on through APDA. Eventually, the Cards and
- ; Drivers book will contain the new gamma information,
- ; but that's a long time away...
- ;NuBusTester folder - contains a library to detect new ROMs with fixed
- ; slot manager (slot manger that runs in 32-bit mode
- ; as opposed to 24-bit mode)
- ;Training Tools folder - contains MacDraw drawings of exploded
- ; configuration ROMs (like the existing Apple video
- ; card ROM and the Apple EtherNet board ROM.
- ;
- ;Slot tools folder - Inside, you'll find these tools:
- ;
- ; CRCPatch - MPW tool that calculates and patches in
- ; the crc value of the assembled Declaration ROM file.
- ;
- ; Data - MPW tool takes the assembled file and strips off the code 0
- ; segment,leaving the code 1 segment (the raw code). The resulting
- ; file can then be downloaded to a rom burning machine.
- ;
- ; Tjscomm - A small terminal program that can be used to download the data
- ; file to a rom burning machine.
- ;
- ; SlotMgrTst - application that excersises the slot manager by making slot
- ; manager calls
- ;
- ; GetsInfo - application that displays sResources and other configuration ROM
- ; information
- ;
- ; Disclaimer: the above may be reorganized at any time, or changed via additions and deletions.
- ;
- ;
- ; The general structure of this example ROM is:
- ;
- ; [Format/Header]
- ; |
- ; |
- ; [sResource Directory]
- ; / \
- ; / \
- ; / \
- ; / \
- ; [Board sResource] [Functional sResource]
- ; - Primary Init. - Driver Directory.
- ; - Vendor Info.
- ;
- ;
- ; If you want to print this, I suggest using landscape mode!!!
- ;
- ;-------------------------------------------------------------------
-
- MACHINE MC68020
-
- ;=====================================================================
- ; Initial Assembler Directives
- ;=====================================================================
- STRING C
- ;Note new names since C & D book!
- PRINT OFF
- INCLUDE 'SysErr.a' ;Macintosh System equates
- INCLUDE 'SysEqu.a' ;Macintosh System equates
- INCLUDE 'ROMEqu.a' ;Declaration ROM equates
- INCLUDE 'SlotEqu.a' ;Slot Manager equates and macros
- INCLUDE 'TimeEqu.a' ;Macintosh traps
- INCLUDE 'Traps.a' ;Macintosh traps
- PRINT ON
-
- ;
- ;=====================================================================
- ; BEGIN Declaration ROM
- ;=====================================================================
- SampleDeclROM MAIN
-
-
-
- ;*************************************************************
- ;Constants
- ;*************************************************************
-
- ROMSize EQU $1000 ;4K byte ROM in this example
- TheBoardId EQU $0000 ;the Board Id (GOTTEN from DTS!)
-
- ;board sResource equates
- ;The board sResource ALWAYS has sRsrc_Type of $0001 0000 0000 0000
- ;that is, <Category> = $0001 ALWAYS for board sResource
- ; <Type> = $0000 ALWAYS for board sResource
- ; <DrvrSW> = $0000 ALWAYS for board sResource
- ; <DrvrHW> = $0000 ALWAYS for board sResource
- ;catBoard EQU 1 ;commented out since already defined in ROMEqu.a
- ;TypeBoard EQU 0 ;commented out since already defined in ROMEqu.a
- DrvrSwBoard EQU 0 ;
- DrvrHwBoard EQU 0 ;
-
- ;Functional sResource equates.
- ; DON'T USE THESE - GET VALUES FROM DTS. FOR EXAMPLE ONLY
- CatWhatCat EQU $6666 ;
- TypWhatType EQU $7777 ;
- DrSwWhatSWid EQU $8888 ;
- DrHwWhatHWid EQU $9999 ;
-
- defMinorBase EQU 0 ;in this example, RAM Offset is 0
- defMinorLength EQU $40000 ;in this example, RAM length is $40000
-
- ;----------- sResource Directory ;<Id OF>
- sRsrc_Board EQU 1 ;Board sResource {May be any number in [0..127]}
- sRsrc_Video EQU 128 ;Video sResource {May be any number in [128..254]}
-
-
- ;=====================================================================
- ; Directory
- ;=====================================================================
- _sRsrcDir OSLstEntry sRsrc_Board,_sRsrc_Board ;References the board sResource.
- OSLstEntry sRsrc_Video,_sRsrc_Fun ;References the functional sResource. *** ASSIGNED BY MACDTS ***
- DatLstEntry endOfList,0 ;End of the list.
-
-
- ;=============================================================
- ; sRsrc_Board List
- ;=============================================================
- _sRsrc_Board OSLstEntry sRsrcType,_BoardType ;References the sResource type (type always same for bd sResource).
- OSLstEntry sRsrcName,_BoardName ;References the sResource name.
- DatLstEntry boardId,TheBoardId ;The board Id. *** ASSIGNED BY MACDTS ***
- OSLstEntry primaryInit,_sPInitRec ;References the Primary init record.
- OSLstEntry vendorInfo,_VendorInfo ;References the Vendor information list.
- DatLstEntry endOfList,0 ;End of the list.
-
- _BoardType DC.W CatBoard ;<Category>
- DC.W TypBoard ;<Type>
- DC.W DrvrSwBoard ;<DrvrSw>
- DC.W DrvrHwBoard ;<DrvrHw>
- _BoardName DC.L 'OFFICIAL PRODUCT NAME HERE' ;The name of the Board - should be official product name
-
-
- ;-------------------------------------------------------------
- ; Primary Init Record (if needed)
- ;-------------------------------------------------------------
- _sPInitRec DC.L _EndsPInitRec-_sPInitRec ;The physical Block Size
- ;;; INCLUDE 'PrimaryInit.a' ;The Header/Code (See PrimaryInit.a)
- _EndsPInitRec EQU * ;End of block
- STRING C ;Restore to 'c' string type.
-
-
- ;-------------------------------------------------------------
- ; Vendor Info record
- ;-------------------------------------------------------------
- _VendorInfo OSLstEntry VendorId,_VendorId ;References the Vendor Id. *** VENDOR DEFINES THIS, NOT MACDTS. ***
- OSLstEntry RevLevel,_RevLevel ;References the Revision Level. *** VENDOR DEFINES THIS, NOT MACDTS. ***
- OSLstEntry PartNum,_PartNum ;References the Part Number. *** VENDOR DEFINES THIS, NOT MACDTS. ***
- DatLstEntry endOfList,0 ;End of the list.
-
- _VendorId DC.L 'MOST PUT COMPANY NAME HERE' ;The Vendor Id
- _RevLevel DC.L 'Beta-99.0' ;The Revision Level (whatever is desired)
- _PartNum DC.L 'ABC-1' ;The Part Number (whatever is desired)
-
-
- ;=============================================================
- ; sRsrc_Video
- ;=============================================================
- _sRsrc_Fun OSLstEntry sRsrcType,_FunType ;References the functional sResource Type.
- OSLstEntry sRsrcName,_FunName ;References the functional sResource Name.
- OSLstEntry sRsrcDrvrDir,_FunDrvrDir ;References the functional sResource driver directory.
- DatLstEntry sRsrcHWDevId,1 ;The hardware device Id.
- OSLstEntry MinorBaseOS,_MinorBase ;References the Minor Base Offset.
- OSLstEntry MinorLength,_MinorLength ;References the Minor Base Length.
- DatLstEntry endOfList,0 ;End of the list.
-
- ;Functional sRsrc_Type labels, equates assigned by MacDTS
- _FunType DC.W CatWhatCat ;<Category>
- DC.W TypWhatType ;<Type>
- DC.W DrSwWhatSWid ;<DrvrSw>
- DC.W DrHwWhatHWid ;<DrvrHw>
-
- _FunName DC.L 'WhatCat_WhatType_WhatSWid_WhatHWid' ;Convention: _FunName is derived by
- ;using _FunName above, but stripping
- ;off the Cat,Typ, and DrSw/Hw prefixes, then
- ;separating by underscores
-
- _MinorBase DC.L defMinorBase ;RAM Offset is 0 (for example!)
- _MinorLength DC.L defMinorLength ;RAM length is $40000 (for example!)
- ;often this sort of thing is put in a dependant equates
- ;file (Apple puts video card dependent equates in the
- ;file DepVidEqu.a for example). I put them at the top
- ;of this file to put them in one file. Note the values
- ;used here are just for example purposes.
-
-
- ;-------------------------------------------------------------
- ; Driver directory (if on board driver)
- ;-------------------------------------------------------------
- _FunDrvrDir OSLstEntry sMacOS68020,_sMacOS68020 ;References the Macintosh-OS 68020 driver.
- DatLstEntry endOfList,0 ;End of the list.
-
-
- ;Driver-1 (68020).
- _sMacOS68020 DC.L _End020Drvr-_sMacOS68020 ;The physical Block Size
- ;;; INCLUDE 'NameofDrvrSourceCodeFile.a' ;The Header/Code
- _End020Drvr EQU * ;The end of the driver.
- STRING C
-
-
-
-
- ORG ROMSize-FHeaderRec.fhBlockSize
- ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ; Format/Header Block
- ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- DC.L (_sRsrcDir-*)**$00FFFFFF ;Offset to sResource directory
- DC.L ROMSize ;Length of declaration data
- DC.L 0 ;CRC {Patched by crcPatch (MPW tool)}
- DC.B romRevision ;Revision level
- DC.B AppleFormat ;Format
- DC.L TestPattern ;Test pattern
- DC.B 0 ;Reserved byte (must be zero)
- DC.B $E1 ;ByteLanes: 1110 0001 (bytelane 0)
-
-
- ENDP
-
- END
-
- ;